#!/bin/bash

cd `dirname $0`

ping -c 5 192.168.60.199  > /dev/null

if [ $? -ne 0 ]
then
    echo -e "\033[31m 199 down .... \033[0m"
    exit 0
fi

if [ -z "`df | grep -i "192.168.60.199/public" | grep -v "grep"`" ]
then
    mount //192.168.60.199/public /data/public/ -o username=zg,password=zg,uid=zg,gid=zg,vers=1.0 -t cifs
else
    #echo -e "\033[32m 199/public already mounted .... \033[0m"
    exit 0
fi

if [ -z "`df | grep -i "192.168.60.199/public" | grep -v "grep"`" ]
then
    echo -e "\033[31m mount 199/public faild .... \033[0m"
else
    echo -e "\033[32m mount 199/public successful .... \033[0m"
fi
